package cn.net.zidian.mvvm.adapter;


import android.text.Html;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import cn.net.zidian.R;
import cn.net.zidian.bean.TodayBean;

public class TodayAdapter extends BaseQuickAdapter<TodayBean, BaseViewHolder> {
    public TodayAdapter() {
        super(R.layout.item_today);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, TodayBean item) {
        if (item != null) {
            baseViewHolder.setText(R.id.tv_name, item.getYear() + "年" + item.getMonth() + "月" + item.getDay() + "日"
                    + item.getTitle());
            baseViewHolder.setText(R.id.tv_info, "历史：" + Html.fromHtml(item.getContent()));
        }
    }
}
